Disable dependency on libexecinfo including in autodetected cases.

diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index cd45176c..5e0f5f57 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -151,7 +151,6 @@ check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL)
 check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT)
 check_library_exists(m pow "" COMPILER_RT_HAS_LIBM)
 check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD)
-check_library_exists(execinfo backtrace "" COMPILER_RT_HAS_LIBEXECINFO)
 
 # Look for terminfo library, used in unittests that depend on LLVMSupport.
 if(LLVM_ENABLE_TERMINFO STREQUAL FORCE_ON)
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 83512760..b7b2950c 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -254,8 +254,6 @@ endif()
 # function checks
 check_symbol_exists(arc4random "stdlib.h" HAVE_DECL_ARC4RANDOM)
 find_package(Backtrace)
-set(HAVE_BACKTRACE ${Backtrace_FOUND})
-set(BACKTRACE_HEADER ${Backtrace_HEADER})
 
 # Prevent check_symbol_exists from using API that is not supported for a given
 # deployment target.
diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake
index 21ce3a94..2d3817c1 100644
--- a/llvm/include/llvm/Config/config.h.cmake
+++ b/llvm/include/llvm/Config/config.h.cmake
@@ -23,11 +23,6 @@
    backslashes. */
 #cmakedefine01 LLVM_WINDOWS_PREFER_FORWARD_SLASH
 
-/* Define to 1 if you have the `backtrace' function. */
-#cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE}
-
-#define BACKTRACE_HEADER <${BACKTRACE_HEADER}>
-
 /* Define to 1 if you have the <CrashReporterClient.h> header file. */
 #cmakedefine HAVE_CRASHREPORTERCLIENT_H
 
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 5044b263..c9b3e94f 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -40,14 +40,6 @@ elseif( CMAKE_HOST_UNIX )
   if( HAVE_LIBDL )
     set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
   endif()
-  if( HAVE_BACKTRACE AND NOT "${Backtrace_LIBRARIES}" STREQUAL "" )
-    # On BSDs, CMake returns a fully qualified path to the backtrace library.
-    # We need to remove the path and the 'lib' prefix, to make it look like a
-    # regular short library name, suitable for appending to a -l link flag.
-    get_filename_component(Backtrace_LIBFILE ${Backtrace_LIBRARIES} NAME_WE)
-    STRING(REGEX REPLACE "^lib" "" Backtrace_LIBFILE ${Backtrace_LIBFILE})
-    set(system_libs ${system_libs} ${Backtrace_LIBFILE})
-  endif()
   if( LLVM_ENABLE_TERMINFO )
     set(imported_libs ${imported_libs} Terminfo::terminfo)
   endif()
